package com.cwh.taskcenter.task.converter;

import com.alibaba.fastjson2.JSON;
import com.cwh.taskcenter.domain.task.model.TaskRule;
import com.cwh.taskcenter.task.model.TaskRuleDO;

/**
 * @author cwh
 */
public class TaskRuleConverter {

    public static TaskRuleDO toTaskRuleDO(TaskRule taskRule) {
        TaskRuleDO taskRuleDO = new TaskRuleDO();
        taskRuleDO.setEventType(taskRule.getEventType());
        taskRuleDO.setTaskId(taskRule.getTaskId());
        taskRuleDO.setRuleJson(JSON.toJSONString(taskRule));
        return taskRuleDO;
    }

}
